package com.xxxx.server.config;

/**
 * Created by HMF on 2021/08/14 22:45
 */

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * MyBatis分页配置（分页插件配置）
 */
@Configuration
public class MyBatisPlusConfig {

    @Bean
    public PaginationInterceptor paginationInterceptor() {
        // 原理就是你查询的时候被这里拦截，然后加上 limit，实现分页查询
        return new PaginationInterceptor();
    }
}
